package com.changgou.bigdata.controller;

import com.changgou.bigdata.servicer.ARecommendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/arc")
public class ARecommendController {
    @Autowired
    private ARecommendService arService;

    //单关联推荐

    /**
     * 添加权重
     * @param skuId
     */
    @PostMapping("/{skuId}/{username}")
    public void addWeighing(@PathVariable("skuId")String skuId){
        //测试用sku和username注入
        arService.addWeighing(skuId);
    }

    /**
     * 获取推荐
     * @return
     */
    @RequestMapping("/puch")
    public List<String> puchRecommend(@RequestBody List<String> cartSkuids){
        List<String> recommend = arService.getPuchList(cartSkuids);
        return recommend;
    }



}
